package com.howso.cloud.changan.user.controller;


import com.howso.cloud.annotation.LoginClient;
import com.howso.cloud.annotation.LoginUser;
import com.howso.cloud.oauth2.model.LoginAppUser;
import com.howso.cloud.oauth2.model.SysUser;
import com.howso.cloud.result.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@Controller
@RestController
@RequestMapping("/user")
public class TestController {
    /**
     * 当前登录用户 LoginAppUser
     *
     * @return
     */
    @ApiOperation(value = "根据access_token当前登录用户")
    @GetMapping("/current")
    public R<LoginAppUser> getLoginAppUser(@LoginUser SysUser user, @LoginClient String clientId) {
        System.out.println(clientId);
        System.out.println(user);
        return R.ok();
    }
}
